home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0043_Fancy Fader.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  848 b   |  40 lines

  1. procedure fadeout;
  2. var x,y,z : word;
  3.   palbuf: array[0..255,1..3] of byte;
  4. begin
  5.   for y := 0 to 255 do
  6.     begin
  7.       asm cli end;
  8.       port[$3c7] := y;
  9.       for z := 1 to 3 do
  10.         palbuf[y,z] := port[$3c9];
  11.       asm sti end;
  12.     end;
  13.   for x := 0 to 63 do
  14.     begin
  15.       for y := 0 to 255 do
  16.         for z := 1 to 3 do 
  17.           if palbuf[y,z] > 0 then dec(palbuf[y,z]);
  18.       asm
  19.         mov dx,3dah
  20.       @1:
  21.         in al,dx
  22.         test al,8
  23.         jz @1
  24.       @2:
  25.         in al,dx
  26.         test al,8
  27.         jnz @2
  28.       end;
  29.       for y := 0 to 255 do
  30.         begin
  31.           asm cli end;
  32.           port[$3c8] := y;
  33.           for z := 1 to 3 do
  34.             port[$3c9] := palbuf[y,z];
  35.           asm sti end;
  36.         end;
  37.     end;
  38.  
  39. Not the fastest code in the world, but what did you expect?
  40.